<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
<div id="header"></div>
<div id="content"></div>
<div id="footer"></div>
<script>
function MyHeader(f){
    var obj = document.getElementById('header');
    var s = '<h2>这是头部</h2>';
    if (typeof f === 'function') {
        s = s + f();
    }
    obj.innerHTML = s;

}
function MyContent(f){
    var obj = document.getElementById('content');
    var s = '<h2>这是身体</h2>';
    if (typeof f === 'function') {
        s = s + f();
    }
    obj.innerHTML = s;
}
function MyFooter(f){
    var obj = document.getElementById('footer');
    var s = '<h2>这是尾部</h2>';
    if (typeof f === 'function') {
        s = s + f();
    }
    obj.innerHTML = s;
}
var s1,s2,s3;
var s1 = function (){
    return "<h3>后面再跟上logo</h3>"
}

var s2 = function (){
    return "<h3>window.location 对象在编写时可不使用 window 这个前缀。</h3>"
}




MyHeader(s1);
MyContent(s2);
MyFooter(s3);

</script>
</body>
</html>